import { query } from "../db/db";
export const code = {
    async insert(code) {
        const sql = 'insert into user_code set ?'
        const res = await query(sql, code)
        return res;
    },
    async getCode(phone) {
        const sql = 'select * from user_code where phone=? order by create_time desc limit 1'
        const res = await query(sql, phone)
        return res[0]
    }
}